home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
diskmags
/
0022-3.564
/
dmg-0090
/
sten.txt
/
gemdos.asc
< prev
next >
Wrap
Text File
|
1997-04-16
|
33KB
|
1,012 lines
GEMDOS
======
The ST operating system (TOS) is a mixture of an Atari operating
system and Microsofts Graphic Environment Manager (GEM), ie
GEMDOS, BIOS, XBIOS, AES routines. In theory any of the OS's can
control the system and may be mixed freely with each other.
What follows are as complete a set of GEMDOS calls as I can
compile from the sources available to me and examples in both GFA
Basic and ASSEMBLER of how to call the routines.
It should be noted that the contents of registers
d0,d1,d2,a0,a1,a2 should always be considered to be trashed.
Output from the routines are normally held in register d0 on
return.
To call a routine from Assembler:
move.n param,-(SP) n=byte/word/long
repeat above until all parameters
have been passed.
move.w func#,-(SP) function number
trap #1 call gemdos function
add.w stack, SP return stack to its origional value
if the function returns anything eg
an error code it will be held in
the register d.0
What follows are two examples of using GEMDOS funtions in
assembly language.
EXAMPLE 1:
==========
* Print a string to the screen and wait for a key to be
* pressed before returning.
pea mess ,-(a7) Push address of string onto stack
move.w #$09,-(a7) Print string (null terminated)
trap #$1 Call GEMDOS #$09
add.l #$06, a7 Square up stack
move.w #$07,-(a7) Wait for key to be pressed
trap #$1 Call GEMDOS #$07
add.l #$02, a7 Square up stack
move.w #$00,-(a7) Return to desktop.
trap #$1 Call GEMDOS #$00
* No stack to square up
mess dc.b 27,69
* 27,69 = Clear screen and home cursor.
dc.b 10,10,10
* 10,10,10 = Perform three line feeds.
dc.b " HI THERE! EASY ISN'T IT!",13,10,10
dc.b "ANY KEY TO RETURN TO DESKTOP",0
* The message to be printed.
* 13 = Carraige return.
* 0 = End of message.
end
EXAMPLE 2:
==========
* Check to see if the printer is on-line
* and print an appropriate message.
* Clear the screen for message.
pea clr ,-(a7) Clear the screen
move.w #$09,-(a7) GEMDOS #$09
trap #$01 call it,
add.l #$06, a7 square up stack.
* Call #$11 checks to see if the printer is
* on-line. It returns 0 in D.0 if not.
move.w #$11,-(a7) GEMDOS #$11
trap #$01 call it,
add.l #$02, a7 square up stack.
* Check returned value.
tst.l d0 Test to see if zero.
* Select appropriate message.
bne online If not 0 printer is on.
pea off ,-(a7) Put offline mess. onto stack.
bra rest Jump over next bit.
online pea on ,-(a7) Put online mess. onto stack.
* Print appropriate message.
rest move.w #$09,-(a7) GEMDOS #$09
trap #$01 call it,
add.l #$06, a7 square up stack.
* Request key-press when ready to return.
pea any ,-(a7) Return to calling rotine
move.w #$09,-(a7) GEMDOS #$09
trap #$01 call it,
add.l #$06, a7 square up stack.
* On key-press return to calling routine.
* (In this case, the desktop).
move.w #$01,-(a7) GEMDOS #$01
trap #$01 call it,
add.l #$02, a7 square up stack.
* Return to desktop.
move.w #$00,-(a7) No error,
move.w #$4c,-(a7) GEMDOS #$4c
trap #$01 call it.
* No stack to tidy.
* Messages to be printed.
* =======================
clr dc.b 27,69,10,10,10,0
off dc.b "THE PRINTER IS OFF LINE.",13,10,10,0
on dc.b "OK! THE PRINTER IS ON LINE.",13,10,10,0
any dc.b "PRESS ANY KEY TO CONTINUE.",0
end
To call a routine from GFA Basic:
Either use VOID GEMDOS(parameters) when the function returns no
result or it isn't required. Ret% = GEMDOS(parameters) will
return the result nornally held in register D.0 in the variable.
The parameters are passed as in the following example of Func. 3C
(Function number, parameters in reverse order to those listed)
(&H3C,L:addr,attr)
It is assumed that any parameter passed is WORD length (16 bits)
otherwise the length must be stated. IE L: for a 32 bit word and
B: for a 8 bit word.
EXAMPLE 1
=========
'
' WHEN RUNNING THIS PROGRAM FROM THE GFA BASIC INTERPRETER
' IT WILL CAUSE THE MOUSE POINTER TO LOCK UP ON RETURN TO
' THE DESKTOP.
'
' THE COMPILED VERSION OF IT IS OK!
'
' I CAN ONLY ASSUME THAT RETURNING TO THE DESKTOP IN THIS
' MANNER FROM THE INTERPRETER DOES NOT TIDY THE STACK
' CORRECTLY. CAN ANYONE LET ME KNOW THE REAL REASON?
'
'
'
'
' NOTE! IN BASIC YOU MUST DEFINE THE STRING BEFORE TRYING
' TO DERTERMINE ITS STRAT POSITION...LOGICAL REALLY.
'
' Message to be printed
' ---------------------
Mess$=Chr$(27)+Chr$(69)+Chr$(10)+Chr$(10)+Chr$(10)
Mess$=Mess$+" HI! THERE! EASY ISN'T IT!"+Chr$(13)+Chr$(10)+
Chr$(10)
Mess$=Mess$+"ANY KEY TO RETURN TO DESKTOP"+Chr$(0)
'
'
' Print a message to the screen
' -----------------------------
Void Gemdos(9,L:Varptr(Mess$))
'
'
' Wait for a key to be pressed
' ----------------------------
Void Gemdos(7)
'
'
' Return
' ------
Void Gemdos(0)
'
'
End
EXAMPLE 2
=========
'
' WHEN RUNNING THIS PROGRAM FROM THE GFA BASIC INTERPRETER
' IT WILL CAUSE THE MOUSE POINTER TO LOCK UP ON RETURN TO
' THE DESKTOP.
'
' THE COMPILED VERSION OF IT IS OK!
'
' I CAN ONLY ASSUME THAT RETURNING TO THE DESKTOP IN THIS
' MANNER FROM THE INTERPRETER DOES NOT TIDY THE STACK
' CORRECTLY. CAN ANYONE LET ME KNOW THE REAL REASON?
'
'
'
' NOTE! IN BASIC YOU MUST DEFINE THE STRING BEFORE TRYING
' TO DERTERMINE ITS START POSITION...LOGICAL REALLY.
'
' Messages to be printed
' ----------------------
Cls$=Chr$(27)+Chr$(69)+Chr$(10)+Chr$(10)+Chr$(10)+Chr$(0)
'
Off$="THE PRINTER IS OFF-LINE."+Chr$(13)+Chr$(10)+Chr$(10)+
Chr$(0)
'
On$="OK! THE PRINTER IS ON-LINE."+Chr$(13)+Chr$(10)+Chr$(10)+
Chr$(0)
'
Any$="PRESS ANY KEY TO CONTINUE."+Chr$(0)
'
'
' Clear screen, home the cursor and print three blank lines
' ---------------------------------------------------------
Void Gemdos(&H9,L:Varptr(Cls$))
'
'
' Get printer status. NB: st% holds status on return
' --------------------------------------------------
St%=Gemdos(&H11)
'
'
' Act on value of st%
' -------------------
If St%=0 ! PRINTER OFF-LINE
Mess%=Varptr(Off$)
Else ! PRINTER ON-LINE
Mess%=Varptr(On$)
Endif
'
'
' Print appropriate message
' -------------------------
Void Gemdos(&H9,L:Mess%)
'
'
' Print 'ANY KEY..' message
' -------------------------
Void Gemdos(&H9,L:Varptr(Any$))
'
'
' Wait for keypress
' -----------------
Void Gemdos(&H7)
'
'
' Return to desktop
' -----------------
Void Gemdos(&H4C,0)
'
'
End
Both Assembler and Basic examples are in the GEMDOS.EX folder on
side one of this disc. They are in both ASCII and .PRG format.
Note the different sizes of the resulting .PRG files from each
source.
HERE IS THE COMPLETE LIST OF GEMDOS FUNCTIONS AND ERROR CODES
=============================================================
$00 - Terminate process (old form), p_term_o
PARAMETERS..NO
RESULT......NO
STACK.......2
NOTES.......Terminates the current program, with a return code of
0. Function 4C should be used instead of this one.
-----------------------------------------------------------------
$01 - Read character from keyboard & echo, c_conin
PARAMETERS..NO
RESULT......D0.L = key code
STACK.......2
NOTES.......Waits for a key to be pressed, echos it to the
screen and returns its value. The result is a long
word with the ASCII code in the lower 8 bits, the
physical key code in bits 16-23 and all other bits 0.
-----------------------------------------------------------------
$02 - Write character to screen, c_conout
PARAMETERS..WORD : Character
RESULT......NO
STACK.......4
NOTES.......Writes the given character to the screen. A 16 bit
parameter is supported so bytes must be ANDed with FF
before calling. At the moment the upper 8 bits are
ignored.
-----------------------------------------------------------------
$03 - Read character from auxiliary port, c_auxin
PARAMETERS..NO
RESULT......D0.B = Character read
STACK.......2
NOTES.......Waits for a byte to be received from the auxiliary
device. (RS 232 port).
-----------------------------------------------------------------
$04 - Write character to auxiliary device, c_auxout
PARAMETERS..WORD : Character
RESULT......NO
STACK.......4
NOTES.......Sends a character out via the RS 232 port. The upper
8 bits should be set to 0 for future compatibility.
See function 02.
-----------------------------------------------------------------
$05 - Write character to printer, c_prnout
PARAMETERS..WORD : Character
RESULT......NO
STACK.......4
NOTES.......Sends a character out via the parallel printer port.
The upper 8 bits should be set to 0. See function 2.
Returns -1 if OK otherwise 0 after 30ms timeout.
-----------------------------------------------------------------
$06 - Raw I/O to standard I/O, c_rawio
PARAMETERS..WORD : Character for output or 00FF to read.
RESULT......D0.W if 00FF passed.
STACK.......4
NOTES.......If the character passed is 00FF then the keyboard is
scanned and the result returned in D0, 0 if there is
no key being pressed. Otherwise the character is
printer to the screen.
-----------------------------------------------------------------
$07 - Raw input from keyboard, c_rawcin
PARAMETERS..NO
RESULT......D0.L = character read.
STACK.......2
NOTES.......Waits for a key to be pressed andreturns its value.
It is not echoed to the screen.
-----------------------------------------------------------------
$08 - Read character from the keyboard, c_necin
PARAMETERS..NO
RESULT......D0.L = character read.
STACK.......2
NOTES.......Waits for a key to be pressed and returns its value.
The Control keys, C/S/Q, are interpreted in their
usual way. ie Ctrl-C aborts the program, Ctrl-S
pauses output and Ctrl-Q resumes output.
There is no echo to the screen.
-----------------------------------------------------------------
$09 - Write a string to the screen, c_conws
PARAMETERS..LONG : Adress of string.
RESULT......NO
STACK.......6
NOTES.......The string must be terminated with a null char. ie 0.
-----------------------------------------------------------------
$0A - Read edited string from keyboard, c_conrs
PARAMETERS..LONG : Address of input buffer.
RESULT......NO
STACK.......6
NOTES.......Before this routine is called the first byte of the
buffer should be set to the size of the data portion
of the buffer. On return the second byte of the
buffer contains the length of the string, the string
starts at the third byte. The control keys CTRL-C/H/I
/J/M/R/U/X have their normal 'edit' meaning.
-----------------------------------------------------------------
$0B - Check status of keyboard, c_conis
PARAMETERS..NO
RESULT......D0.L = -1 if char available, 0 otherwise.
STACK.......2
NOTES.......This only indicates whether a key is being pressed.
-----------------------------------------------------------------
$0E - Set default drive, d_setdrv
PARAMETERS..WORD : Drive number.
RESULT......D0.L = Bit map of drives in system.
STACK.......4
NOTES.......Drives are numbered 0=A, 1=B.... The returned value
has a bit set for each installed drive.
-----------------------------------------------------------------
$10 - Check status of standard output, c_conos
PARAMETERS..NO
RESULT......D0.L = -1 if ready, 0 if not.
STACK.......2
NOTES.......Checks to see if console device is ready for output.
Currently always -1.
-----------------------------------------------------------------
$11 - Check status of printer, c_prnos
PARAMETERS..NO
RESULT......D0.L = -1 if ready, 0 if not.
STACK.......2
NOTES.......Checks to see if the printer is on line.
-----------------------------------------------------------------
$12 - Check status of serial port input, c_auxis
PARAMETERS..NO
RESULT......D0.L = -1 if ready, 0 if not.
STACK.......2
NOTES.......Checks the RS 232 port to see if there is a character
waiting to be read.
-----------------------------------------------------------------
$13 - Check status of serial port output, c_auxos
PARAMETERS..NO
RESULT......D0.L = -1 if ready, 0 if not.
STACK.......2
NOTES.......Checks the RS 232 port to see if it is ready to
receive a character.
-----------------------------------------------------------------
$19 - Get default drive, d_getdrv
PARAMETERS..NO
RESULT......D0.W = drive number.
STACK.......2
NOTES.......Returns the current drive number, 0=A, 1=B...
-----------------------------------------------------------------
$20 - Enter supervisor/user mode, s_super
PARAMETERS..LONG : Value for stack or 0 or -1.
RESULT......D0.L = variable, see notes.
STACK.......6
NOTES.......This can either tell you that the program is in User
or Supervisor mode or it can switch from one to
another. To determine which mode the processor is in,
call the function with a parameter of -1. The
returned value will be 0 for user and 1 for
supervisor mode. To switch modes a new stack pointer
must be passed, or 0 if it is to remain unchanged, to
the parameters.
-----------------------------------------------------------------
$1A - Set disc transfer address, f_setdta
PARAMETERS..LONG : Pointer to disc transfer address.
RESULT......NO
STACK.......6
NOTES.......Sets the address of a 44 byte buffer used for
searching for filenames. Used by f_sfirst, No.4E.
-----------------------------------------------------------------
$2A - Get date, t_getdate
PARAMETERS..NO
RESULT......D0.W = date.
STACK.......2
NOTES.......Reads the date and holds the results in the format:
bits 0-4 (1-31) = day,
bits 5-8 (1-12) = month,
bits 9-15 (1980-2100) = year.
-----------------------------------------------------------------
$2B - Set date, t_setdate
PARAMETERS..WORD : Date.
RESULT......NO
STACK.......4
NOTES.......Same as function 2A.
-----------------------------------------------------------------
$2C - Get time, t_gettime
PARAMETERS..NO
RESULT......D0.W = Time.
STACK.......2
NOTES.......Returns the time in format:
bits 0-4 (0-60-even) = seconds,
bits 5-10 (1-60) = minutes,
bits 11-15 (0-24) = hours.
-----------------------------------------------------------------
$2D - Set time, t_settime
PARAMETERS..WORD : Time.
RESULT......NO
STACK.......4
NOTES.......Sets the current time. Format as function 2C.
-----------------------------------------------------------------
$2F - Get disc transfer address, f_getdta
PARAMETERS..NO
RESULT......D0.L = pointer to disc transfer address.
STACK.......2
NOTES.......Should always be even. Address used by 4E.
-----------------------------------------------------------------
$30 - Get version number, s_version
PARAMETERS..NO
RESULT......D0.W = version number
STACK.......2
NOTES.......Returns GEMDOS version number. The major number is in
the low byte and the minor number is in the high byte.
$0D00 - ver. 0.13 (disc based).
$1300 - ver. 0.19 (ROM based).
-----------------------------------------------------------------
$31 - Terminate and stay resident, p_termres
PARAMETERS..WORD : Exit code.
LONG : Bytes to keep.
RESULT......NO
STACK.......8
NOTES.......Allows a program to terminate but also to remain in
memory. This is useful for those programs which
expand the system such as screen dumps and ram discs.
The memory which is retained is that starting from
the base page. The length parameter should include
the $100 bytes for the base page plus the program
length and data and stack space if necessary.
-----------------------------------------------------------------
$36 - Get drive free space, d_free
PARAMETERS..WORD : Drive code.
LONG : Pointer to buffer.
RESULT......NO
STACK.......8
NOTES.......Returns information on a specified disc drive. The
drive code is 0=default, 1=A, 2=B... etc. The buffer
should be 16 bytes and will have four long words of
information placed in it. These are, free space,
number of clusters, sector size (bytes) and cluster
size (sectors).
-----------------------------------------------------------------
$39 - Create a sub-directory, d_create
PARAMETERS..LONG : Address of pathname.
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......This will create a new entry as defined by a null
terminated string.
-----------------------------------------------------------------
$3A - Delete a sub-directory, d_delete
PARAMETERS..LONG : Address of pathname
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......Deletes the directory if it contains no files.
-----------------------------------------------------------------
$3B - Set current directory, d_setpath
PARAMETERS..LONG : Address of pathname
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......Sets the current directory according to the null
terminated string. This trap may be unreliable on
GEMDOS v0.13.
-----------------------------------------------------------------
$3C - Create a file, f_create
PARAMETERS..WORD : Attributes.
LONG : Pointer to string.
RESULT......D0.W = file handle if OK, else error coge (-ve).
STACK.......8
NOTES.......Attempts to create a file. If successful it will
return a file handle for use by other GEMDOS
functions.
WORD can be : 1 = read only,
2 = hidden file,
4 = hidden system file,
8 = filename contains volume name in
first 11 bytes.
The file handle numbers returned start at 6 and go
upwards. Handles from 0-5 are standard handles which
are opened when a program starts. They are:
0 = console input,
1 = console output,
2 = serial port,
3 = parallel port,
4 = undefined,
5 = undefined.
-----------------------------------------------------------------
$3D - Open file, f_oopen
PARAMETERS..WORD : Mode.
LONG : Pointer to filename.
RESULT......D0.W = handle if OK, else error code (-ve).
STACK.......8
NOTES.......Opens an existing file for reading, writing or both.
The mode word must be one of:
0 = open to read,
1 = open to write,
2 = open to read and write.
If successful the function will return a handle as
described in function 3C.
-----------------------------------------------------------------
$3E - Close file, f_close
PARAMETERS..WORD : Handle.
RESULT......D0.W = 0 if OK, else error code.
STACK.......4
NOTES.......Closes files corresponding to the file handle.
-----------------------------------------------------------------
$3F - Read file, f_read
PARAMETERS..LONG : Load address.
LONG : Number of bytes to read.
WORD : Handle.
RESULT......D0.W = number of bytes read or error code (-ve).
STACK.......12
NOTES.......Attempts to read bytes from the given file. If the
end of the file is reached before all the bytes are
read no error code is returned. The bytes read should
be compared with the number asked for.
-----------------------------------------------------------------
$40 - Write file, f_write
PARAMETERS..LONG : Start address.
LONG : Bytes to write.
WORD : Handle.
RESULT......D0.W = Number of bytes written, else error code(-ve).
STACK.......12
NOTES.......Attempts to write bytes to the given file. If the
disc becomes full before all the bytes are written no
error code is given. Compare the bytes written to the
bytes specified.
-----------------------------------------------------------------
$41 - Delete file, f_delete
PARAMETERS..LONG : Pointer to filename.
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......Attempts to delete the given file.
-----------------------------------------------------------------
$42 - Seek file pointer, f_seek
PARAMETERS..WORD : Mode.
WORD : File.
LONG : Position.
RESULT......D0.W = absolute position in file after seek.
STACK.......10
NOTES.......Moves a file pointer to a given position within the
file. The mode word is defined:
0 = move N bytes from start of file,
1 = move N bytes from current position,
2 = move N bytes from end of file.
If the pointer is moved past either end of the file
the result is 0 or the file length.
-----------------------------------------------------------------
$43 - Get or set file attributes, f_attrib
PARAMETERS..WORD : Attributes.
WORD : Get/set.
LONG : Pointer to filename.
RESULT......D0.W = new attributes, else error code.
STACK.......10
NOTES.......The attribute word should be set to one of:
$01 = read only,
$02 = hidden file,
$04 = hidden system file,
$08 = filename with volume name in 1st 11 bytes,
$10 = subdirectory,
$20 = file is written and closed.
The get/set word is set to:
0 = to GET or 1 = to SET.
-----------------------------------------------------------------
$45 - Duplicate file handle, f_dup
PARAMETERS..WORD : Standard handle.
RESULT......D0.W = new handle, else error code.
STACK.......4
NOTES.......Returns a new handle that can be used to address a
standard input device (0-5), May be closed without
affecting standard device handle.
-----------------------------------------------------------------
$46 - Force file handle, f_force
PARAMETERS..WORD : Non-standard handle.
WORD : Standard handle.
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......Forces the standard handle to point to the same
device/file as the non-standard one. A use would be
to re-direct screen output to a disc file.
-----------------------------------------------------------------
$47 - Get current directory, d_getpath
PARAMETERS..WORD : Drive number.
LONG : Pointer to buffer.
RESULT......D0.W = 0 if OK, else error code.
STACK.......8
NOTES.......The current directory is returned in the given buffer
( in null terminated format ) for any given drive
number, A=0, B=1, ... The buffer should be 64 bytes
long.
-----------------------------------------------------------------
$48 - Allocate memory, m_alloc
PARAMETERS..LONG : Number of bytes required.
RESULT......D0.L = address of memory allocated. Failure = 0.
STACK.......6
NOTES.......Allocates the given amount of memory from the system
pool, if available. When a program terminates all of
its memory allocations are cleared. This call will
also return the amount of free memory if-1 is passed.
NOTE - This call will occasionally return an ODD
value for the start of the allocated memory.
-----------------------------------------------------------------
$49 - Free alloctaed memory, m_free
PARAMETERS..LONG : Address of area to free.
RESULT......D0.W = 0 if OK, else error code.
STACK.......6
NOTES.......Frees the bock of memory allocated by function $48.
-----------------------------------------------------------------
$4A - Shrink allocated memory, m_shrink
PARAMETERS..LONG : Length to keep.
LONG : Start address to keep.
WORD : 0.
RESULT......D0.W = 0 if OK, else error code.
STACK.......12
NOTES.......Normally used when a program starts and then has to
release part of the allocted memory back to GEMDOS.
-----------------------------------------------------------------
$4B - Load or execute a program, p_exec
PARAMETERS..LONG : Pointer to evironment string.
LONG : Pointer to command line.
LONG : Pointer to filename.
WORD : Mode.
RESULT......D0.L = depends on mode.
STACK.......16
NOTES.......Used to RUN or CHAIN programs. Mode can be one of the
following: 0 - Load and execute
3 - Load but do not execute
For 0, the return value is either an error code or
the value returned when the Child program is exited.
For 3, the return value is either an error code or a
pointer to the base page of the loaded program. To
subsequently pass control to the loaded program:
move.l d0,a0 ; pointer to base page
jmp $100(a0) ; jump to it
The environment string is usually a null string.
-----------------------------------------------------------------
$4C - Terminate program, p_term
PARAMETERS..WORD : return value.
RESULT......N/A - doesn't return.
STACK.......N/A
NOTES.......Terminates the current program, returning control to
the parent program (Normally Desktop on the ST). The
word value returned should normally be an error code
( 0 = no error ). Returned error codes should be
positive to avoid confusion with system error codes
which are negative.
-----------------------------------------------------------------
$4E - Search for first, f_sfirst
PARAMETERS..WORD : Attributes.
LONG : Pointer to filespec.
RESULT......D0.W = 0 if found, else -33 if not found.
STACK.......8
NOTES.......Can be used to scan a directory using wildcards to
find all the files. This function is called to find
the first one and $4F is used to find the rest. When
a file is found the parameters are returned in the
DTA buffer area. The attribute word determines which
file types are to be included in the search and may
be one of:
$00 - normal files
$01 - read only files
$02 - hidden files
$04 - system files
$08 - return volume name only
$10 - subdirectories
$20 files that have been written to and closed
The returned values in the DTA buffer are:
0-20 - reserved for internal use
21 - file attributes
22-23 - file time stamp
24-25 - file date stamp
26-29 - file size (long)
30-43 - name and extension of file (null termin.)
The address of the DTA buffer may be set with $1A and
read with $2F.
-----------------------------------------------------------------
$4F - Search for next occurence, f_snext
PARAMETERS..NONE.
RESULT......D0.W = 0 if found, else -33 if not found.
STACK.......2
NOTES.......After calling $4E to find the first occurence of a
filespec this call is used to find subsequent files.
When a file is found the DTA buffer is filled as
described previously. For it to work the first 20
bytes of the DTA buffer must remain unaltered
between calls.
-----------------------------------------------------------------
$56 - Rename a file, f_rename
PARAMETERS..LONG : Pointer to new name.
LONG : Pointer to old name.
WORD : 0
RESULT......D0.W = 0 if OK, else error code.
STACK.......12
NOTES.......Will attempt to rename the old file to that of the
newname. A file of the newname must not already exist.
-----------------------------------------------------------------
$57 - Get/set file date and time stamp
PARAMETERS..WORD : 0=set 1=get.
WORD : File handle.
LONG : Pointer to buffer.
RESULT......NONE.
STACK.......10
NOTES.......May be used to get or set the time and date stamp on
an open file. The buffer should contain two words,
the first being the time and the second being the
date in the format described previously.
ERROR CODES
===========
ERROR PCDOS SUPPORTED NOT SUPPORTED
CODE EQUIV.
-32 1 Invalid function number
-33 2 File not found
-34 3 Path not found
-35 4 No handles left (Too many files open)
-36 5 Access denied
-37 6 Invalid handle
-38 7
-39 8 Insufficient memory
-40 9 Invalid memory
block address
-41 10 Insufficient memory
-42 11 Insufficient memory
-43 12
-44 13
-45 14
-46 15 Invalid drive specification
-47 16 Invalid operation
-48 17
-49 18 No more files
Next to get the same treatment will be the BIOS and XBIOS
functions. DAVE MOONEY